-
Notifications
You must be signed in to change notification settings - Fork 427
[WIP] Add simpler version of ParticleTile using 2D array #4404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AlexanderSinn
wants to merge
47
commits into
AMReX-Codes:development
Choose a base branch
from
AlexanderSinn:Add_simpler_version_of_ParticleTile_using_2D_array
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP] Add simpler version of ParticleTile using 2D array #4404
AlexanderSinn
wants to merge
47
commits into
AMReX-Codes:development
from
AlexanderSinn:Add_simpler_version_of_ParticleTile_using_2D_array
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rticleTile_using_2D_array
…rticleTile_using_2D_array
Member
|
Hi @AlexanderSinn - is this still something you're working on? Do you think it would be worthwhile to keep pushing on this? |
Member
Author
|
Yes. There is still a lot left to do. I am waiting for Axel to return and give feedback first |
5 tasks
atmyers
added a commit
that referenced
this pull request
Jul 3, 2025
## Summary In preparation of #4404, this PR reduces the reliance of SuperParticle. The issue with getSuperParticle is that the compiler is instructed to read in all the data of the particle into registers even if most of it is not needed. Additionally, runtime data is not accessible through SuperParticle. ## Additional background The previous version of packIOData with RunOnGpu had a bug when some particles were invalid. ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate --------- Co-authored-by: Andrew Myers <[email protected]>
…rticleTile_using_2D_array
5 tasks
atmyers
pushed a commit
that referenced
this pull request
Aug 13, 2025
## Summary This PR adds a `SetArena(Arena*)` function to ParticleContainerBase that allows setting a memory arena that is used for all the particle vectors if the allocator is PolymorphicArenaAllocator. The function has to be called before particle tiles are defined. This functionality is used to fix a bunch of places where a polymorphic vector would previously not have its arena set properly. Additionally the `RunOnGpu` logic in `AMReX_WriteBinaryParticleData.H` is extended to work with a polymorphic allocator. Uses changes extracted from #4404. ## Additional background Previously all components of all particle tiles needed their arena set individually by the user if PolymorphicArenaAllocator was used. In case this was done this PR is a braking change due to the `AMREX_ALWAYS_ASSERT_WITH_MESSAGE(a_arena != nullptr` assert in `ParticleTile::define()`. ## Checklist The proposed changes: - [ ] fix a bug or incorrect behavior in AMReX - [x] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
Member
|
@atmyers can you pls prioritize this PR in the coming week(s)? :) 🙏 |
…rticleTile_using_2D_array
Member
Author
|
This PR depends on #4529 btw |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR aims to explore adding a simpler version of ParticleTile #3570
It already assumes that a tile only has runtime components and always has a polymorphic arena allocator as described in #4380. To avoid the array of pointer style of the current particle tile, here a 2D array over particle ids and component ids is used. As a simplification both AoS and SoA members have been removed as well as all the push_back functions.
Performance test with HiPACE++:
dev, ParticleContainerPureSoA<11, 1>
ParticleContainerPureSoA<0, 0> using only runtime components
this PR, ParticleContainerPureSoA2<amrex::Real, int>
Additional background
ParticleReal and int are replaced with template types to make implementing the const versions easier and to allow for more flexibility in the future (use double and float in the same application, use double2 or float4, use 64 bit int etc).
Checklist
The proposed changes: